<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});
//后台登陆路由
Route::get('admin/login', 'admin\Index@login')->name('login');;
Route::post('/admin/dologin','admin\Index@dologin');
Route::get('/admin/logout','admins\Index@logout');
// 后台验证码
Route::get('/admin/captcha','admin\Index@captcha');
Route::namespace('admin')->middleware(['auth','rights'])->group(function () {
    Route::get('admin/index', 'Index@index');
    Route::get('admin/index/welcome', 'Index@welcome');
    Route::get('admin/admin/index', 'Admin@index');
    Route::get('admin/admin/add', 'Admin@add');
    Route::post('admin/admin/save', 'Admin@save');
    //角色路由
    Route::get('admin/groups/index', 'Groups@index');
    Route::get('admin/groups/add', 'Groups@add');
    Route::get('admin/groups/edit', 'Groups@edit');
    Route::post('admin/groups/save', 'Groups@save');
    //权限菜单路由
    Route::get('admin/menus/index', 'Menus@index');
    Route::get('admin/menus/add', 'Menus@add');
    Route::get('admin/menus/edit', 'Menus@edit');
    Route::post('admin/menus/save', 'Menus@save');
    Route::post('admin/menus/del', 'Menus@del');
    //网站设置路由
    Route::get('admin/setting/index', 'Setting@index');
    Route::post('admin/setting/save', 'Setting@save');
    Route::get('admin/setting/short', 'Setting@short');
    Route::post('admin/setting/short_save', 'Setting@short_save');
    //敏感词
    Route::get('admin/sensitive/sw_index', 'Sensitive@sw_index');
    Route::get('admin/sensitive/sw_add', 'Sensitive@sw_add');
    Route::post('admin/sensitive/sw_save', 'Sensitive@sw_save');
    Route::post('admin/sensitive/del_sw', 'Sensitive@del_sw');
    //文章分类路由
    Route::get('admin/article/cates', 'Article@cates');
    Route::get('admin/article/add_cate', 'Article@add_cate');
    Route::post('admin/article/save_cate', 'Article@save_cate');
    Route::post('admin/article/del_cate', 'Article@del_cate');
    //文章路由
    Route::get('admin/article/index', 'Article@index');
    Route::get('admin/article/add', 'Article@add');
    Route::get('admin/article/see', 'Article@see');
    Route::post('admin/article/see_save', 'Article@see_save');
    Route::post('admin/article/save', 'Article@save');
    //文件上传路由
    Route::post('/admin/files/upload_img','Files@upload_img');
    //轮播图路由
    Route::get('admin/banner/index', 'Banner@index');
    Route::get('admin/banner/add', 'Banner@add');
    Route::post('admin/banner/save', 'Banner@save');
    //友情链接路由
    Route::get('/admin/link/index','Link@index');
    Route::get('/admin/link/add','Link@add');
    Route::post('/admin/link/save','Link@save');
    Route::post('/admin/link/del','Link@del');
    //用户路由
    Route::get('/admin/member/index','Member@index');
    Route::get('/admin/member/member_menu','Member@member_menu');
    Route::get('/admin/member/member_add','Member@member_add');
    Route::get('/admin/member/member_edit','Member@member_edit');
    Route::get('/admin/member/member_save','Member@member_save');
    Route::get('/admin/member/member_del','Member@member_del');
});
Route::post('/home/files/upload_img','home\Files@upload_img');
//前台路由
Route::get('/','home\Index@index');
//Route::get('/','home\Index@index')->middleware('authmember');
Route::get('/lists/{id}','home\Lists@index');
Route::get('/detail','home\Detail@index');
Route::get('/detail','home\Detail@index');
Route::get('/detail/{id}','home\Detail@index');
Route::get('/search','home\Search@index');
//前台注册路由
Route::get('/home/regis','home\Login@index');
Route::post('/home/login/register','home\Login@register');
//手机号注册
Route::get('/home/login/phoneregister','home\Login@phoneReg');
Route::get('/home/phoneforget','home\Login@forget');
Route::post('/doforget','home\Login@doforget');
Route::get('/phoneyz','home\Login@phoneyz');
//发送验证码路由
Route::post('/sendcode','home\Login@sendCode');
Route::post('/doPhoneRegister','home\Login@doPhoneRegister');
//前台用户登录
Route::get('/home/login','home\Login@login');
Route::post('/home/login/dologin','home\Login@dologin');
Route::get('/home/login/logout','home\Login@logout');
//Route::post('/art/getart','home\Index@getArea');

//个人中心
Route::get('/per/index','home\Personal@index')->middleware('authmember');
Route::get('/home/per/gere','home\Personal@ge_index')->middleware('authmember');
Route::post('/per/ge_save','home\Personal@ge_save')->middleware('authmember');
Route::get('/home/per/article_index','home\Personal@article_index')->middleware('authmember');
Route::get('/home/per/article_add','home\Personal@article_add')->middleware('authmember');
Route::post('/home/per/article_save','home\Personal@article_save')->middleware('authmember');


Route::get('/ce','home\Login@ce');
